package fr.mairie.parc.page.admin;

import java.util.ArrayList;
import java.util.List;

import org.apache.click.ActionListener;
import org.apache.click.Control;
import org.apache.click.control.Button;
import org.apache.click.control.Checkbox;
import org.apache.click.control.FieldSet;
import org.apache.click.control.FileField;
import org.apache.click.control.Form;
import org.apache.click.control.HiddenField;
import org.apache.click.control.ImageSubmit;
import org.apache.click.control.Option;
import org.apache.click.control.Radio;
import org.apache.click.control.RadioGroup;
import org.apache.click.control.Reset;
import org.apache.click.control.Select;
import org.apache.click.control.Submit;
import org.apache.click.control.TextArea;
import org.apache.click.control.TextField;
import org.apache.click.dataprovider.DataProvider;
import org.apache.click.extras.control.DateField;
import org.apache.click.extras.control.DoubleField;
import org.apache.click.extras.control.IntegerField;
import org.apache.click.util.ClickUtils;

import fr.mairie.parc.page.BorderPage;

public class FicheInstallationPage extends BorderPage{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private Form form = new Form("form");
    private Submit submit = new Submit("ok");
    private Select selectMateriel = new Select("Type de materiel");
    private Select selectTechnicien = new Select("Technicien");
	    
	    
	 public FicheInstallationPage() {
	        
		 	addControl(form);
	        

	        form.setErrorsPosition(Form.POSITION_TOP);

	        // Controls FieldSet
	        FieldSet fieldSet = new FieldSet("Information sur l'installation");
	        FieldSet fieldSet2 = new FieldSet("Matériel à récupérer");
	        FieldSet fieldSet3 = new FieldSet("Matériel à installer");
	        form.add(fieldSet);
	        form.add(fieldSet2);
	        form.add(fieldSet3);

	        fieldSet.add(new DateField("Date début : ", true));
	        fieldSet.add(new DateField("Date fin : ", true));
	        selectTechnicien = new Select("technicien", "Technicien");
	        selectTechnicien.setDataProvider(new DataProvider() {
	        	public List getData() {
	        		List optionList = new ArrayList();
	        		optionList.add(new Option("", ""));
	        		optionList.add(new Option("Anais", "Anais"));
	        		optionList.add(new Option("Nadia", "Nadia"));
	        		optionList.add(new Option("Ben", "Ben"));
	        		optionList.add(new Option("Salim", "Salim"));
	        		optionList.add(new Option("Kodjo", "Kodjo"));
	        		optionList.add(new Option("Boubacar", "Boubacar"));
	        		optionList.add(new Option("Apprenti", "Apprenti"));
	        		optionList.add(new Option("Stagiaire", "Stagiaire"));
	        		return optionList;
	        	}
			});
	        fieldSet.add(selectTechnicien);
	        fieldSet.add(new IntegerField("N°Intervention", true));
	        
	        fieldSet2.add(new IntegerField("N°UC", true));
	        fieldSet2.add(new IntegerField("N°Ecran", true));
	        fieldSet2.add(new IntegerField("N°Autre matériel", true));
	        fieldSet2.add( new TextArea("Commentaire sur le travail à effectuer", 39, 3), 2);
	        
	        fieldSet3.add(new IntegerField("N°UC", true)); fieldSet3.add(new TextField("Marque", true));  
	        fieldSet3.add(new IntegerField("N°Ecran", true)); fieldSet3.add(new TextField("Marque2", true)); 
	        fieldSet3.add(new IntegerField("N°Imprimante", true)); fieldSet3.add(new TextField("Marque3", true)); 
	        fieldSet3.add(new IntegerField("N°Autre matériel", true)); fieldSet3.add(new TextField("Marque4", true)); 
	        
	        fieldSet3.add(new TextField("OS", true));
	        

	        Button button = new Button("button");
	        button.setAttribute("onclick", "alert('Button clicked');");
	        form.add(button);
	        ImageSubmit imageSubmit = new ImageSubmit("image", "/assets/images/16*16/save_as.png");
	        imageSubmit.setTitle("ImageSubmit");
	        form.add(imageSubmit);
	        form.add(new Reset("reset"));
	        form.add(new Submit("save"));
 
}
}
